#!/bin/sh

i="${1}"
shift 1

if [ -z "${i}" ]
then
    echo "usage:"
    echo "  ${0} <i> [<option>]"
    exit 1
fi

i=`echo $i | rg -o '[0-9][0-9]$'`

set -ex
gcloud compute tpus delete tpundying0${i} --zone us-central1-f --quiet
exec tpu-create-undying ${i} "$@"
